package com.info.zhiduoduo.core.service.payment.project;

import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.repository.entity.company.CompanyPayment;
import com.info.zhiduoduo.repository.entity.company.CompanyProject;
import com.info.zhiduoduo.repository.entity.order.TradeRecord;

/**
 * 项目支付方式, 策略类
 */
public interface ProjectPaymentService {

	/**
	 * 在发布项目时, 处理账户, 扣除余额或冻结金额
	 *
	 * @param account
	 * @param project
	 */
	void deductCompanyBalanceForPublishProject(CompanyPayment companyPayment, CompanyProject project);

	/**
	 * 处理项目款支付
	 *
	 * @param project
	 * @return
	 */
	SmartResult handlePayment(CompanyProject project);

	/**
	 * 项目支付给创客
	 *
	 * @param project
	 * @return
	 */
	SmartResult handlePayUser(CompanyProject project);

	/**
	 * 处理创客交易结果
	 *
	 * @param project
	 * @param trade
	 */
	void doAfterPayUserTradeSucceed(CompanyProject project, TradeRecord trade);

	/**
	 * 项目支付给九歌统一账户的费用
	 *
	 * @param project
	 * @return
	 */
	SmartResult handlePayJiugeCharge(CompanyProject project);


	/**
	 * 项目服务费支付给九歌统一账户成功,处理后续
	 *
	 * @param project
	 * @param trade
	 */
	void doAfterPayJiugeTradeSucceed(CompanyProject project, TradeRecord trade);
}
